Split-cache having equal size operand and instruction memories

ABSTRACT

A memory control apparatus includes a pair of equal capacity cache memories, one for storing a portion of the instructions located in the main memory and one for storing a portion of the operand data located in the main memory. Each cache memory has an address array and a data array which operate in response to an instruction address from an instruction fetch unit or an operand data address from an operand fetch unit or an operand execution unit. If the instruction or data called for is not in the cache memories, it is taken from the main memory and a copy is placed in an available storage location in the cache memory.

BACKGROUND OF THE INVENTION

The present invention relates to a memory control apparatus for a data processing (DP) system and, more particularly, to a memory control apparatus for a plurality of cache memories.

Recent improvements in packaging technology and IC (integrated circuit) and LSI (large-scale integration) technology has improved the processing speed of computers. This results in a large gap between the operation speed of a central processing unit (CPU) and the access speed for a main memory unit (MMU) having a large capacity. To reduce such a speed gap there is proposed a DP system equipped with a high speed buffer memory (or cache memory) having a small capacity for storing a copy of part of the main memory. For details of the proposed DP system, reference may be made to an article by J. S. Liptay, entitled "Structual aspects of the System/360 Model 85 II, The cache", IBM System Journal, Vol. 7, No. 1, pp. 15-21, 1968. To improve the processing speed of such a system, it is necessary to improve the MMU-access time and to enlarge the memory capacity of the cache memory (CM). For this purpose, an improved DP system is proposed in U.S. Pat. No. 3,618,041. The proposed system is equipped with two CMs for the data and instruction words. The processing speed of the whole system cannot be improved with this system, because attention is not paid to the capacity ratio of the two CMs used, even if the probability that the desired data is not stored in either CM (referred to hereunder as "missing probability" is maintained at a similar degree to that in the other DP system using one CM.

Also, another DP system using a virtual memory technique is disclosed in U.S. Pat. No. 3,317,898. For the efficient use of the MMU, this system has a directory memory for translating a logical address for the MMU into a corresponding real address for the MMU to dynamically relocate various programs on the MMU and thereby to use the MMU as a virtual memory having a memory capacity larger than the physical capacity of the MMU (see the U.S. Pat. No. 3,761,881 for details of such translating operation). For this DP system, the adoption of two CMs can be similarly considered. However, the system thus achieved has the same disadvantges for the same reasons as those stated above.

SUMMARY OF THE INVENTION

One object of the present invention is, therefore, to provide an improved memory control apparatus capable of enhancing the whole processing speed of a DP system by the use of two CMs with an equal capacity.

According to one aspect of the present invention, there is provided a memory control apparatus for a data processing system, which is disposed between a processing unit (PU) including an instruction fetch unit, an operand fetch unit, and an execution unit; and a main memory unit (MMU). The present control apparatus comprises a data cache memory for storing the copy of a portion of a plurality of data stored in the MMU; an instruction cache memory having the same memory capacity as said data cache memory for storing the copy of a portion of a plurality of instruction words stored in the MMU; and means for accessing either one of the cache memories, in response to a read-out request given from the PU to the MMU, for reading out an instruction word or data.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will be described in more detail with reference to the accompanying drawings in which:

FIG. 1 is a block diagram of a first embodiment of the present invention;

FIG. 2 is a diagram showing in detail a first embodient of a cache memory constructed in accordance with the teaching of this invention;

FIGS. 3A and 3B show the relationship between an address array and a data array of FIG. 2;

FIGS. 4A and 4B are diagrams for describing the operation of each structure shown in FIGS. 3A and 3B;

FIGS. 5A, 5B, and 5C are diagrams for the comparison of the processing operation of a DP system based on this invention with that of a conventional DP system;

FIGS. 6A-6E are plots of the relationship of the ratio θ=X_(p) /X_(q) to the number of block cells, n_(I), in the instructions cache memory where the combined number of block cells, n, in the instruction and cache memories and the parameters λ_(I), λ_(D), 1-π_(I) (1), 1-π_(D) (1), B_(I), B_(D) and γ are as stated on the respective plots.

FIGS. 7A-7D are additional plots showing the relationship of θ=X_(p) /X_(q) against the number of block cells, n_(I), in the instruction cache memory, where the combined number of block cells, n, in the instruction and data cache memories and the parameters λ_(I), λ_(D), 1-π_(I) (1), 1-π_(D) (1), B_(I), B_(D) and γ are as stated on the respective plots.

FIG. 8 is a plot of the relationship between the cache memory delay time in the structure shown in FIG. 3B or the DA 208 shown in FIG. 3A and the capacity of a set-associative type cache memory.

FIG. 9 is a diagram showing a second embodiment of the present invention;

FIGS. 10A through 10D are diagrams showing the relationship among a translation-look aside buffer, an address array, and a data array; and

FIG. 11 is a diagram illustrating the disadvantages of the second embodiment.

In all the drawings, identical reference numerals denote identical structural elements.

DETAILED DESCRIPTION OF THE INVENTION

Referring to FIG. 1, the first embodiment comprises an instruction fetch unit 1, cache memories (CMs) 2 and 6, a main memory (MM) 3, an instruction buffer 4, an operand fetch unit 5, an operand buffer 7, and an execution unit 8. The CMs 6 and 2 are provided, respectively, for the data and instruction storage, so that the capacity of each of the CMs 2 and 6 may be identical, having the same number of block cells and the same number of bytes; in each block cell. Details of the CMs 2 and 6 will be discussed later.

Next, the operation of the present invention is described when applied to a pipelined DP system. For the details of such a pipelined DP system, reference may be made to the U.S. Pat. No. 3,618,041, particularly to FIGS. 7A and 7B of the specification.

More specifically, the embodiment will be described in connection with one instruction stream selected out of a plurality of instruction streams, which operate in parallel with one another in the pipelined system.

In response to an instruction address and an instruction read-out request given from the instruction fetch unit 1 to the instruction CM 2, an instruction is given to the instruction buffer 4 through a line 21 from the CM 2 provided the desired instruction word is in the CM 2.

In the absence of the instruction word in the CM 2, an address is given to the MMU 3 through a line 22, and the MMU 3 provides an instruction word to the buffer 4 and the CM 2 through a line 31.

The instruction word is then transferred from the buffer 4 to the operand fetch unit 5 to decode the instruction and to develope an operand address therefore. The operand address and an operand read-out request are then sent from the unit 5 to the CM 6 to read out corresponding data.

In the presence of the desired data in the CM 6, the data is sent from the CM 6 to the operand buffer 7 through a line 61.

In the absence of the desired data in the CM 6, an address is sent from the CM 6 to the MMU 3 through a line 62 so that the desired data from the MMU 3 is sent to the buffer 7 and the CM 6 through a line 32. The instruction word and the operand data in the buffer 7 are sent from the buffer 7 to the excution unit 8 to excute the instruction. In response to a data fetch request from the unit 8, an address for reading out the data, in addition to a data read-out request, is given to the CM 6 from the unit 8 through a line 81.

If the desired data is present in CM 6, the data is read out of the CM 6 and sent to the unit 8 through a line 63. If the desired data is absent from the CM 6, the data is read out of MMU 3 and given to the unit 8 and the CM 6 through the line 32.

As shown in FIG. 2, each of the CMs 2 and 6 has a similar structure. Referring to FIG. 2, the CM 2 (or 6) comprises an address array 204 and a data array 208. The data array 208 has m sets and n block cells 2081 (hereinafter each of the block cells is referred to as "compartment") per set. Each block cell 2081 can store a plurality of bytes.

The content read out from the MMU 3 is stored in the block cells 2081 of the data array 208. More specifically, the copy of a part of the entire set of instruction words in the MMU 3 is stored in the CM 2, while the copy of a part of the entire set of data in the MMU 3 is stored in the CM 6. The address array 204 and the data array 208 have similar structures. In addition, each address for accessing each block of the MMU 3 is stored in each of block address cells 2041 of the array 204. Each of the cells 2041 corresponds to each of the block cells 2081 of the data array 208. The instruction address from the unit 1, the operand address from the unit 5 or the address from the unit 8 are set in a physical address register 201. Portions 2020 and 2030 of the address field in the register 201 are used to select each set number for the address array 204 and the data array 208. The contents of all block cells in the same set selected at the array 204 are read out in parallel. Each of the contents selected on the lines 2040-1 to 2040-n is compared with a portion 2010 of the content of the register 201 by the comparison circuits 205-1 to 205-n, and these comparison results appear on lines 2050-1-2050-n.

On the other hand, the set number for the data array 208 is also selected by the content 2030, and as a result, the contents of all the block cells designated by the content 2030 are read out in parallel. Only one out of the outputs 2080-1-2080-n of the block cells thus read is selected at selection circuits 209-1 to 209-n in response to comparison result signals given through the lines 2050-1 to 2050-n and is stored in a local register 211 through an OR gate 210. If the desired instruction word or operand data does not exist in the memory 208, an address is given to the MMU 3 from the register 201, so that the desired instruction word or data is read out of MMU 3 and is given to the CM 2 or 6 through the line 31 or the line 32. Signals C₁ -C_(n) are used to select one block cell to store data in the cells 2081 of the set selected by the content 2030. The signals C₁ -C_(n) are given from a cache management circuit (not shown).

For details of the generation of such signals C₁ -C_(n) from the cache management circuit, reference may be made to a paper by J. Gecsei, D. R. Slutz and I. L. Traiger, entitled "Envaluation techniques for storage hierarchies", IBM System Journal, No. 2, 1970, pp. 78-117.

The above-mentioned instruction word or data from the MMU 3 is stored in the selected block cell 2081. Each address for accessing the MMU is stored in each of the block address cells 2041 of the address array 204 corresponding to each of the block cells 2081 through the line 2010 and gates 202-1 to 202-n.

Assuming now that the registers 201 and 211 operate in synchronism with each clock and the logical delay, i.e., the signal propagation delay between the registers 201 and 211 is less than one clock cycle, each of the CMs 2 and 6 assumes the structure as shown in FIG. 3B. Each of the CMs 2 and 6 operates in synchronism with each machine cycle (equal to clock cycle).

The operation of the CM 2 (or 6) shown in FIG. 3B is described hereinafter referring to FIG. 4B. A first address ○1 from the units 1 (5 or 8) is supplied to the address array 204 and at the same time, the address ○1 is supplied to the data array 208, so that the arrays 204 and 208 may operate in parallel at the same address. Accordingly, during the first machine cycle, the parallel operations of the arrays 204 and 208 are made for the same address of the CM 2 (or 6) designated by the first address ○1 . During the second machine cycle, the parallel operations of the arrays 204 and 208 are made for the same address of the CM 2 (or 6) designated by the second address ○2 .

Referring to FIG. 3A, an arrangement of the address array 204 and the data array 208 is made for the case where the identical clocks are supplied in parallel to the comparison circuits 205-1 to 205-N shown in FIG. 2 and each clock is sequentially given to the registers 201 and 211. Consequently, the arrays 204 and 208 operate in parallel to each other at different addresses as shown in FIG. 4A. Referring to FIGS. 1 and 2 and FIGS. 4A and 4B, a first address 1 is supplied to the array 204 from the unit 1 (5 or 8). After one clock cycle has elapsed from the supply of the address ○1 , an address corresponding to the first address from the array 204 is given to the data array 208. In the same clock cycle as the address supply, that is, in the second clock cycle, a second address ○2 is given to the address array 204. As a result, a third address ○3 is supplied to the address array 204 in the same clock cycle as the supply cycle of the second address ○2 to the array 208.

Assuming that each of the CMs 2 and 6 shown in FIG. 1 is composed of the CM shown in FIG. 3B, and two instruction words are fetched at each instruction fetch operation, the operation of the DP system operation shown in FIG. 5A is performed. Compared with the FIG. 5C operation performed by the use of the conventional CM shown in FIG. 3B, the FIG. 5A operation can improve the operation efficiency or, throughput of the DP system.

Assuming that each of the CMs 2 and 6 shown in FIG. 1 is composed of the CM shown in FIG. 3A, the throughput of the DP system can be greatly improved as shown in FIG. 5B compared with that performed by the conventional CM.

In FIGS. 5A, 5B and 5C, I denotes the instruction fetch operation for the unit 1 shown in FIG. 1; I₁, the address array read-out operation for the unit 1 shown in FIG. 1; I₂, the data array read-out operation for the unit 1 shown in FIG. 1; D, the instruction decoding operation at the decoder (not shown); C, the operand fetch operation for the unit 5; C₁, the address array readout operation for the operand data fetch; C₂, the data array read-out operation for the operand data fetch; and E, the execution operation at the unit 8 shown in FIG. 1, respectively.

As discussed above, the CMs 2 and 6 shown in FIG. 1 have an equal capacity or, in other words, the block cell number and the number of bytes per block are made equal for each of the two CMs. As a result, the arrangement of thse separate CMs 2 and 6 (referred to as "SCM" hereunder) achieves the following advantages:

The missing probability X_(p) in the SCM is the same or lower than the missing probability X_(q) in the conventional CM, which is not divided into two (i.e., one for the instruction words and the other for the data). This means that the missing probability may become higher unless the CMs 2 and 6 have the same capacity.

The ratio θ of the probability X_(p) to X_(q) is given by the following formula:

    θ=X.sub.p /X.sub.q

Therefore, if θ=≈1, the missing probability of the SCM is almost the same as that of the conventional CM. The probabilities X_(p) and X_(q) are given by the following equations: ##EQU1## wherein

k is the number of the instruction blocks stored in the SCM or the conventional CM;

l is the number of data blocks stored in the SCM or the conventional CM;

p (k,l) is the probability that there are k instruction blocks and l data blocks in the SCM; and q (k,l) is the probability that there are k instruction blocks and l data blocks in the conventional CM.

Also,

π_(I) (k) and π_(D) (l) are given experimentally by the following equations:

    π.sub.I (k)=1-(1-π.sub.I (1))k.sup.-λ.sbsp.I (k=1, 2 . . . )

    π.sub.D (l)=1-(1-π.sub.D (1)l.sup.-λD (l=1, 2 . . . )

    π.sub.I (0)=π.sub.D (0)=0

wherein π_(I) (1), π_(D) (1), λ_(I), and λ_(D) are constants and

    I-π.sub.I (1), 1-π.sub.D (1)=0.2˜0.8

    λ.sub.I, λ.sub.D =1˜3

when actually measured using the high level language programs such as FORTRAN and COBOL.

Assuming now that the access operation for the MMU is performed with a width of 8 bytes in the DP system, the parameters B_(I) and B_(D) respectively take 0.26 and 0.64 by the calculation based on the Scientific Gibson mix, while the parameters B_(I) and B_(D) takes 0.19 and 0.64 by the Bussiness Gibson Mixture method (see Column 1 of the U.S. Pat. No. 3,618,041).

As shown in FIGS. 6A-6E and 7A-7D, it is obvius that θ≦1 is established only in the case of n_(I) =n/2, that is, in the case where the memory capacity of the CM 2 is equal to that of the CM 6. In this case, the memory capacity of the CM is Y·n (Y is the number of the bytes per block; and n is the total block number equal to n=n_(I) +n_(D)). Also, n_(I) is the block cell number of the CM 2, and n_(D) is the block cell number of the CM 6.

FIG. 8 shows the relationship between the cache delay time in the structure shown in FIG. 3B or the DA 208 shown in FIG. 3A and the capacity of the well-known set-associative type CM with a capacity of 32 bytes/block. Needless to say, the reduction of the cache delay time contributes to the decrease of the machine cycle time. As shown, the delay time is a relative value set at 1 when the CM has a total capacity of 64 kilobytes. For details of the set associative technique, reference may be made to the U.S. Pat. No. 3,588,829. Thus, it is understood that the delay time is decreased by 7 percent for the 32-kilobyte compared to the 64-KB memory. When n_(I) is equal to n_(D), the cache delay time of the SCM is almost equal to that of the conventional CM which has one half of the capacity of the SCM. Therefore, as is evident from FIG. 8, the machine cycle time for the SCM can be

shortened by 5 to 7 percent compared with that for the conventional CM having the same capacity as the SCM.

Assuming that the average time for executing an instruction is T; the missing probability of the CM X; the clock cycle, t; and variables ΔT, ΔX, and Δt, in the DP system, the following formula is obtained:

    ΔT/T=Δt/t+KΔX/X

wherein K is a constant, and in a large-scale DP system, it is empirically

    K=0.1˜0.2.

If each of the CMs 2 and 6 (SCM) has the same capacity, which is one half of the capacity of the conventional CM, the following equations are established from FIGS. 6 to 8:

    ΔX/X≦0

    Δt/t=-(0.05˜0.07).

Therefore, the DP system with such a SCM can shorten the instruction executing time by at least 5 to 7 percent than the conventional CM of the equal capacity.

Referring to FIG. 9, the second embodiment (TLB 90) comprises a logical address register 91, an address decoder 92, a translation-look aside buffer (TLB) memory array 93, comparison circuits 94-1 to 94-m_(T), AND gates 95-I to 95-m_(T), and an OR gate 96. With this embodiment, the TLB is divided into two; one for the access operation for data and the other for the instruction words. The connection between the TLB 90 and the CMs 2 and 6 used in the first embodiment is shown in FIGS. 10A to 10D. In the DP system having a virtual memory technique, an MMU is necessary address is given in the form of page name+displacement or segment name+displacement. As a result, the translation of the page or the segment name into the corresponding physical address of the MMU 3 is necessary. The TLB 90 performs this translating operation. The operation of the second embodiment is now described in further detail. When a portion of the page or segment name field at the logical address register 91 is given to the decoder 92 through line 911, one set is selected out of sets 1-r.sub. T of the TLB memory array 93. The contents of the compartments 1-m_(T) of the selected set are read out in parallel. In each of the compartments is stored the address information consisting of a part of the logical address and the entire physical address of the MMU 3 corresponding to the logical address.

Each of the outputs of the TLB memory array 93 through lines 931 and 933 is compared with the content of the line 912 at comparison circuits 94-1 to 94-m_(T). Next, one real address given from the array 93 through the lines 932 to 934 is selected by the gates 95-1 to 95-m_(T) in response to the contents sent from lines 941 to 942. The selection result is the output of the TLB 90 through the gate 96 and appears on a line 961. The displacement field 913 of the register 91 is directly given to the CMs 2 and 6. The outputs appearing on the lines 961 and 913 are given to the register 201 shown in FIG. 2. The connection between the above-mentioned TLB, the address array (AA), and the data array (DA) shown in FIG. 10A (or 10C) corresponds to the connection between the AA and the DA shown in FIG. 3A (or 3B).

Assuming that the content of the register 201 shown in FIG. 2 is the same as the logical address for the MMU 3, the connection between the TLB, the AA, and the DA shown in FIG. 10B (or 10D) corresponds to that between the AA and the DA shown in FIG. 3A (or 3B).

In the example shown in FIG. 10A, the TLB 90 and the arrays 204 and 208 operate sequentially in response to three consecutive clocks. The array 208 shown in FIG. 10B operates in the next clock cycle after the TLB 90 and the array 204 have operated in parallel during the same one clock cycle. Whereas, in FIG. 10C, the TLB 90 operates at one clock cycle, and the arrays 204 and 208 operate during the next clock cycle in parallel, while in FIG. 10D, all of the TLB 90 and the arrays 204 and 208 operate in parallel. With the construction shown in FIGS. 10B and 10D, the TLB is divided into two (one for instruction and the other for data), in addition to the use of the SCM to perform the DP system operation shown in FIGS. 5B and 5A, respectively. In the construction shown in FIGS. 10A and 10C, the division of the TLB enables a similar efficient operation to that shown in FIG. 5B or FIG. 5A. If the TLB is not divided as shown in FIG. 11, conflict between the instruction fetch and the data fetch at the TLB arises, the operation efficiency of the DP system is deteriorated in a similar way shown in FIG. 5C.

The MMU 3 and the CMs 2 and 6 may be respectively composed of MMU 2 and, BM 112, 114, 116, and 118 shown in FIG. 1 of the U.S. Pat. No. 3,618,041. TLB 90 may also be composed of Translation Look Aside Table 14 disclosed in the U.S. Pat. No. 3,761,881. 

What is claimed is:
 1. In a data processing system, a memory control apparatus connected to a main memory unit (MMU) and a processing unit (PU), said processing unit including an instruction fetch unit, an operand fetch unit, and an execution unit, said control apparatus comprising:a data cache memory (6) for storing a copy of a portion of a plurality of data stored in the MMU; an instruction cache memory (2) having the same memory capacity as said data cache memory for storing a copy of a portion of a plurality of instructions stored in the MMU; and each of said instruction cache memory (2) and data cache memory (6) including address storing means (204) and data storing means (208), said data cache memory (6) being connected to the operand fetch unit (5) via a first line (51) and said instruction cache memory (2) being connected to the instruction fetch unit (1) via a second line (11); whereby the ratio of missing probabilities, θ is minimized, and the average instruction execution time is shortened relative to that of a conventional single cache memory having a capacity equal to the combined capacities of the data cache memory and the instruction cache memory, and the average instruction execution time is shortened relative to a conventional split-cache having unequal size stores where the instruction cache memory has a different storage capacity from that of the data cache memory.
 2. A memory control apparatus as claimed in claim 1 further comprising, addressing means (201) for holding an address representative of the address of an instruction and data in said MMU respectively, means (203) responsive to a portion of said address for reading out a set of cache-stored addresses therefrom, means (205-1 . . . 205-n) for comparing each of said read-out cache-stored addresses with another part of said address in said addressing means to detect which, if any, of said cache-stored addresses corresponds to said address in said addressing means, means (206) responsive to a portion of said address in said addressing means for reading out a set of cache-stored instructions and data, respectively, and means (209-1 . . . 209-n, 210) responsive to said comparison means for selecting for further processing the instruction and data from said read-out sets of instructions and data in cache storage locations corresponding to the read-out cache address which oorresponds to said address in said address holding means.
 3. A memory control apparatus as claimed in claim 1 further comprising, addressing means (201) for holding an address representative of the address of an instruction and data in said MMU respectively, means (203) responsive to a portion of said address for reading out a set of cache-stored addresses therefrom, means (205-1 . . . 205-n) for comparing each of said read-out cache-stored addresses with another part of said address in said addressing means to detect which, if any, of said cache-stored addresses corresponds to said address in said addressing means, means responsive to a portion of said address in said addressing means and an address corresponding to the comparison result from said comparision means for reading out cache-stored instructions and data, respectively.
 4. A memory control apparatus as claimed in claim 1 wherein each of said instruction cache memory and data cache memory comprises, an address array (204) for storing m sets of n blocks of addresses, and a data array (208) for storing m sets of n blocks of instructions of data, said data array having stored therein a copy of said instructions or data from said MMU, and said address array having stored in each block thereof an address corresponding to the MMU address of the instruction or data stored in the corresponding block of the data array.
 5. A memory control apparatus as claimed in claim 4 wherein said data array (208) and address array (204) for each said cache memory are connected to operate in parallel.
 6. A memory control apparatus as claimed in claim 4 wherein said address array (204) and data array (208) for each said cache memory are connected to operate in sequence so that the data array read-out and selection for a given address occurs after the address array read-out and comparison for said given address. 